﻿<%@ Page Title="Strategic Asset Management Las Vegas: User Management" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
    CodeBehind="UserManagement.aspx.cs" Inherits="LenderClearingHouse.UserManagement" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphPageHeader" runat="server">
    User Management
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMain" runat="server">
    <asp:Panel ID="pnlNotifications" runat="server">
        LVREO&nbsp;Notification:&nbsp;<asp:TextBox ID="tbLvreoNotification" runat="server" Width="350"></asp:TextBox>&nbsp;&nbsp;
        SDREO&nbsp;Notification:&nbsp;<asp:TextBox ID="tbSdreoNotification" runat="server" Width="350"></asp:TextBox>&nbsp;&nbsp;
        <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" /><br /><br />
    </asp:Panel>
    <div class="panel5">
        <table width="940" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="10" height="32" valign="middle">
                    &nbsp;
                </td>
                <td width="35" valign="middle">
                    <img src="images/excel_icon.png" width="30" height="30" />
                </td>
                <td width="150" valign="middle">
                    <asp:LinkButton ID="lnkExportVIP" runat="server" Text="Export VIP" CssClass="link1" onclick="lnkExportVIP_Click"></asp:LinkButton>
                </td>
                <td width="*">
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>

    <asp:SqlDataSource ID="sqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SQLConnection %>"
        SelectCommand="getManageUsers" SelectCommandType="StoredProcedure" DeleteCommand="deleteUser"
        DeleteCommandType="StoredProcedure">
        <DeleteParameters>
            <asp:Parameter Name="UserID" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
                <asp:ControlParameter ControlID="hfUserId" Name="currentUserId" 
                    PropertyName="Value" Type="Int32" />
            </SelectParameters>
    </asp:SqlDataSource>
    <asp:HiddenField ID="hfUserId" runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grid" UpdatePanelHeight="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="grid" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
        AllowSorting="True" AutoGenerateColumns="False" DataSourceID="sqlDataSource"
        GridLines="None" AllowAutomaticDeletes="True" ShowStatusBar="True" OnInsertCommand="grid_InsertCommand"
        OnUpdateCommand="grid_UpdateCommand" AllowMultiRowEdit="True">
        <ClientSettings>
            <Scrolling UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView DataSourceID="sqlDataSource" DataKeyNames="UserId" CommandItemDisplay="Top">
            <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Delete this user?"
                    ConfirmTitle="Delete" UniqueName="column">
                </telerik:GridButtonColumn>
                <telerik:GridEditCommandColumn ButtonType="ImageButton">
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="Fname" HeaderText="First Name" SortExpression="Fname"
                    UniqueName="Fname">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="LName" HeaderText="Last Name" SortExpression="LName"
                    UniqueName="LName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Email" HeaderText="Email" SortExpression="Email"
                    UniqueName="Email">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="Is_Active" DataType="System.Boolean" HeaderText="Active"
                    SortExpression="Is_Active" UniqueName="Is_Active">
                </telerik:GridCheckBoxColumn>
                <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role" SortExpression="RoleName"
                    UniqueName="LvreoRoleName">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="WebUserControl" UserControlName="EditUserControl.ascx">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>
